3.1.49 \(\int \sin ^4(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\) [49]

3.1.49.1 Optimal result
3.1.49.2 Mathematica [A] (verified)
3.1.49.3 Rubi [A] (verified)
3.1.49.4 Maple [A] (verified)
3.1.49.5 Fricas [A] (verification not implemented)
3.1.49.6 Sympy [F]
3.1.49.7 Maxima [A] (verification not implemented)
3.1.49.8 Giac [B] (verification not implemented)
3.1.49.9 Mupad [B] (verification not implemented)

3.1.49.1 Optimal result

Integrand size = 23, antiderivative size = 122 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {1}{8} \left (3 a^2-30 a b+35 b^2\right ) x-\frac {(a-9 b) (a-b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {\left (a^2-10 a b+13 b^2\right ) \tan (e+f x)}{4 f}+\frac {(a-b)^2 \sin ^4(e+f x) \tan (e+f x)}{4 f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

output
1/8*(3*a^2-30*a*b+35*b^2)*x-1/8*(a-9*b)*(a-b)*cos(f*x+e)*sin(f*x+e)/f-1/4* 
(a^2-10*a*b+13*b^2)*tan(f*x+e)/f+1/4*(a-b)^2*sin(f*x+e)^4*tan(f*x+e)/f+1/3 
*b^2*tan(f*x+e)^3/f
 
3.1.49.2 Mathematica [A] (verified)

Time = 2.27 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.79 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {12 \left (3 a^2-30 a b+35 b^2\right ) (e+f x)-24 \left (a^2-4 a b+3 b^2\right ) \sin (2 (e+f x))+3 (a-b)^2 \sin (4 (e+f x))+32 b \left (6 a-10 b+b \sec ^2(e+f x)\right ) \tan (e+f x)}{96 f} \]

input
Integrate[Sin[e + f*x]^4*(a + b*Tan[e + f*x]^2)^2,x]
 
output
(12*(3*a^2 - 30*a*b + 35*b^2)*(e + f*x) - 24*(a^2 - 4*a*b + 3*b^2)*Sin[2*( 
e + f*x)] + 3*(a - b)^2*Sin[4*(e + f*x)] + 32*b*(6*a - 10*b + b*Sec[e + f* 
x]^2)*Tan[e + f*x])/(96*f)
 
3.1.49.3 Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.12, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4146, 366, 360, 1467, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (e+f x)^4 \left (a+b \tan (e+f x)^2\right )^2dx\)

\(\Big \downarrow \) 4146

\(\displaystyle \frac {\int \frac {\tan ^4(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\left (\tan ^2(e+f x)+1\right )^3}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 366

\(\displaystyle \frac {\frac {(a-b)^2 \tan ^5(e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}-\frac {1}{4} \int \frac {\tan ^4(e+f x) \left (a^2-10 b a+5 b^2-4 b^2 \tan ^2(e+f x)\right )}{\left (\tan ^2(e+f x)+1\right )^2}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 360

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \int \frac {8 b^2 \tan ^4(e+f x)-2 (a-9 b) (a-b) \tan ^2(e+f x)+(a-9 b) (a-b)}{\tan ^2(e+f x)+1}d\tan (e+f x)-\frac {(a-9 b) (a-b) \tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )+\frac {(a-b)^2 \tan ^5(e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{f}\)

\(\Big \downarrow \) 1467

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \int \left (8 b^2 \tan ^2(e+f x)-2 \left (a^2-10 b a+13 b^2\right )+\frac {3 a^2-30 b a+35 b^2}{\tan ^2(e+f x)+1}\right )d\tan (e+f x)-\frac {(a-9 b) (a-b) \tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )+\frac {(a-b)^2 \tan ^5(e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (\left (3 a^2-30 a b+35 b^2\right ) \arctan (\tan (e+f x))-2 \left (a^2-10 a b+13 b^2\right ) \tan (e+f x)+\frac {8}{3} b^2 \tan ^3(e+f x)\right )-\frac {(a-9 b) (a-b) \tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )+\frac {(a-b)^2 \tan ^5(e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{f}\)

input
Int[Sin[e + f*x]^4*(a + b*Tan[e + f*x]^2)^2,x]
 
output
(((a - b)^2*Tan[e + f*x]^5)/(4*(1 + Tan[e + f*x]^2)^2) + (-1/2*((a - 9*b)* 
(a - b)*Tan[e + f*x])/(1 + Tan[e + f*x]^2) + ((3*a^2 - 30*a*b + 35*b^2)*Ar 
cTan[Tan[e + f*x]] - 2*(a^2 - 10*a*b + 13*b^2)*Tan[e + f*x] + (8*b^2*Tan[e 
 + f*x]^3)/3)/2)/4)/f
 

3.1.49.3.1 Defintions of rubi rules used

rule 360
Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] : 
> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p 
+ 1))), x] + Simp[1/(2*b^(m/2 + 1)*(p + 1))   Int[(a + b*x^2)^(p + 1)*Expan 
dToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 
- 1)*(b*c - a*d))/(a + b*x^2)] - (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; 
FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[m/2, 0] & 
& (IntegerQ[p] || EqQ[m + 2*p + 1, 0])
 

rule 366
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^2, 
x_Symbol] :> Simp[(-(b*c - a*d)^2)*(e*x)^(m + 1)*((a + b*x^2)^(p + 1)/(2*a* 
b^2*e*(p + 1))), x] + Simp[1/(2*a*b^2*(p + 1))   Int[(e*x)^m*(a + b*x^2)^(p 
 + 1)*Simp[(b*c - a*d)^2*(m + 1) + 2*b^2*c^2*(p + 1) + 2*a*b*d^2*(p + 1)*x^ 
2, x], x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LtQ[p 
, -1]
 

rule 1467
Int[((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), 
 x_Symbol] :> Int[ExpandIntegrand[(d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x], 
x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e 
 + a*e^2, 0] && IGtQ[p, 0] && IGtQ[q, -2]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4146
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_ 
)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[c*(ff^(m + 1)/f)   Subst[Int[x^m*((a + b*(ff*x)^n)^p/(c^2 + ff^2*x^2)^(m/ 
2 + 1)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x 
] && IntegerQ[m/2]
 
3.1.49.4 Maple [A] (verified)

Time = 1.65 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.63

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{7}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{5}+\frac {5 \sin \left (f x +e \right )^{3}}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )-\frac {15 f x}{8}-\frac {15 e}{8}\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{9}}{3 \cos \left (f x +e \right )^{3}}-\frac {2 \sin \left (f x +e \right )^{9}}{\cos \left (f x +e \right )}-2 \left (\sin \left (f x +e \right )^{7}+\frac {7 \sin \left (f x +e \right )^{5}}{6}+\frac {35 \sin \left (f x +e \right )^{3}}{24}+\frac {35 \sin \left (f x +e \right )}{16}\right ) \cos \left (f x +e \right )+\frac {35 f x}{8}+\frac {35 e}{8}\right )}{f}\) \(199\)
default \(\frac {a^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{7}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{5}+\frac {5 \sin \left (f x +e \right )^{3}}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )-\frac {15 f x}{8}-\frac {15 e}{8}\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{9}}{3 \cos \left (f x +e \right )^{3}}-\frac {2 \sin \left (f x +e \right )^{9}}{\cos \left (f x +e \right )}-2 \left (\sin \left (f x +e \right )^{7}+\frac {7 \sin \left (f x +e \right )^{5}}{6}+\frac {35 \sin \left (f x +e \right )^{3}}{24}+\frac {35 \sin \left (f x +e \right )}{16}\right ) \cos \left (f x +e \right )+\frac {35 f x}{8}+\frac {35 e}{8}\right )}{f}\) \(199\)
risch \(\frac {3 x \,a^{2}}{8}-\frac {15 x a b}{4}+\frac {35 x \,b^{2}}{8}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} a^{2}}{64 f}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} a^{2}}{64 f}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} b^{2}}{64 f}+\frac {3 i {\mathrm e}^{2 i \left (f x +e \right )} b^{2}}{8 f}-\frac {4 i b \left (-3 a \,{\mathrm e}^{4 i \left (f x +e \right )}+6 b \,{\mathrm e}^{4 i \left (f x +e \right )}-6 a \,{\mathrm e}^{2 i \left (f x +e \right )}+9 b \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a +5 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a^{2}}{8 f}-\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} a b}{32 f}+\frac {i {\mathrm e}^{4 i \left (f x +e \right )} a b}{32 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a^{2}}{8 f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a b}{2 f}-\frac {3 i {\mathrm e}^{-2 i \left (f x +e \right )} b^{2}}{8 f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} b^{2}}{64 f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a b}{2 f}\) \(306\)

input
int(sin(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 
output
1/f*(a^2*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)+2*a 
*b*(sin(f*x+e)^7/cos(f*x+e)+(sin(f*x+e)^5+5/4*sin(f*x+e)^3+15/8*sin(f*x+e) 
)*cos(f*x+e)-15/8*f*x-15/8*e)+b^2*(1/3*sin(f*x+e)^9/cos(f*x+e)^3-2*sin(f*x 
+e)^9/cos(f*x+e)-2*(sin(f*x+e)^7+7/6*sin(f*x+e)^5+35/24*sin(f*x+e)^3+35/16 
*sin(f*x+e))*cos(f*x+e)+35/8*f*x+35/8*e))
 
3.1.49.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.98 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (3 \, a^{2} - 30 \, a b + 35 \, b^{2}\right )} f x \cos \left (f x + e\right )^{3} + {\left (6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{6} - 3 \, {\left (5 \, a^{2} - 18 \, a b + 13 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 16 \, {\left (3 \, a b - 5 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 8 \, b^{2}\right )} \sin \left (f x + e\right )}{24 \, f \cos \left (f x + e\right )^{3}} \]

input
integrate(sin(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
 
output
1/24*(3*(3*a^2 - 30*a*b + 35*b^2)*f*x*cos(f*x + e)^3 + (6*(a^2 - 2*a*b + b 
^2)*cos(f*x + e)^6 - 3*(5*a^2 - 18*a*b + 13*b^2)*cos(f*x + e)^4 + 16*(3*a* 
b - 5*b^2)*cos(f*x + e)^2 + 8*b^2)*sin(f*x + e))/(f*cos(f*x + e)^3)
 
3.1.49.6 Sympy [F]

\[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{4}{\left (e + f x \right )}\, dx \]

input
integrate(sin(f*x+e)**4*(a+b*tan(f*x+e)**2)**2,x)
 
output
Integral((a + b*tan(e + f*x)**2)**2*sin(e + f*x)**4, x)
 
3.1.49.7 Maxima [A] (verification not implemented)

Time = 0.37 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.07 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {8 \, b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (3 \, a^{2} - 30 \, a b + 35 \, b^{2}\right )} {\left (f x + e\right )} + 24 \, {\left (2 \, a b - 3 \, b^{2}\right )} \tan \left (f x + e\right ) - \frac {3 \, {\left ({\left (5 \, a^{2} - 18 \, a b + 13 \, b^{2}\right )} \tan \left (f x + e\right )^{3} + {\left (3 \, a^{2} - 14 \, a b + 11 \, b^{2}\right )} \tan \left (f x + e\right )\right )}}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{24 \, f} \]

input
integrate(sin(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
 
output
1/24*(8*b^2*tan(f*x + e)^3 + 3*(3*a^2 - 30*a*b + 35*b^2)*(f*x + e) + 24*(2 
*a*b - 3*b^2)*tan(f*x + e) - 3*((5*a^2 - 18*a*b + 13*b^2)*tan(f*x + e)^3 + 
 (3*a^2 - 14*a*b + 11*b^2)*tan(f*x + e))/(tan(f*x + e)^4 + 2*tan(f*x + e)^ 
2 + 1))/f
 
3.1.49.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 12581 vs. \(2 (112) = 224\).

Time = 23.41 (sec) , antiderivative size = 12581, normalized size of antiderivative = 103.12 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\text {Too large to display} \]

input
integrate(sin(f*x+e)^4*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
 
output
1/96*(9*pi*a*b*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2 
*tan(f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^7*tan(e)^7 - 15*pi*b^ 
2*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan 
(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^7*tan(e)^7 + 36*a^2*f*x*tan(f*x)^7 
*tan(e)^7 - 360*a*b*f*x*tan(f*x)^7*tan(e)^7 + 420*b^2*f*x*tan(f*x)^7*tan(e 
)^7 + 9*pi*a*b*sgn(-2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan(e)^2 + 2*tan(f*x) 
 - 2*tan(e))*tan(f*x)^7*tan(e)^7 - 15*pi*b^2*sgn(-2*tan(f*x)^2*tan(e) + 2* 
tan(f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^7*tan(e)^7 + 18*pi*a*b 
*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan( 
e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^7*tan(e)^5 - 30*pi*b^2*sgn(2*tan(f* 
x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan(e)^2 + 2*tan( 
f*x) - 2*tan(e))*tan(f*x)^7*tan(e)^5 - 27*pi*a*b*sgn(2*tan(f*x)^2*tan(e)^2 
 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2*tan(f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan( 
e))*tan(f*x)^6*tan(e)^6 + 45*pi*b^2*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2* 
tan(f*x)^2*tan(e) + 2*tan(f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^ 
6*tan(e)^6 + 18*pi*a*b*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*ta 
n(e) + 2*tan(f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^5*tan(e)^7 - 
30*pi*b^2*sgn(2*tan(f*x)^2*tan(e)^2 - 2)*sgn(-2*tan(f*x)^2*tan(e) + 2*tan( 
f*x)*tan(e)^2 + 2*tan(f*x) - 2*tan(e))*tan(f*x)^5*tan(e)^7 + 18*a*b*arctan 
((tan(f*x) + tan(e))/(tan(f*x)*tan(e) - 1))*tan(f*x)^7*tan(e)^7 - 30*b^...
 
3.1.49.9 Mupad [B] (verification not implemented)

Time = 10.11 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.05 \[ \int \sin ^4(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=x\,\left (\frac {3\,a^2}{8}-\frac {15\,a\,b}{4}+\frac {35\,b^2}{8}\right )+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a\,b-3\,b^2\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\left (\frac {5\,a^2}{8}-\frac {9\,a\,b}{4}+\frac {13\,b^2}{8}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {3\,a^2}{8}-\frac {7\,a\,b}{4}+\frac {11\,b^2}{8}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \]

input
int(sin(e + f*x)^4*(a + b*tan(e + f*x)^2)^2,x)
 
output
x*((3*a^2)/8 - (15*a*b)/4 + (35*b^2)/8) + (tan(e + f*x)*(2*a*b - 3*b^2))/f 
 + (b^2*tan(e + f*x)^3)/(3*f) - (tan(e + f*x)*((3*a^2)/8 - (7*a*b)/4 + (11 
*b^2)/8) + tan(e + f*x)^3*((5*a^2)/8 - (9*a*b)/4 + (13*b^2)/8))/(f*(2*tan( 
e + f*x)^2 + tan(e + f*x)^4 + 1))